<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Index Lemmas</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Index Lemmas' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inbuildn.html">Inbuild Modules</a></li><li><a href="index.html">supervisor</a></li><li><a href="index.html#7">Chapter 7: Extension Management</a></li><li><b>Index Lemmas</b></li></ul></div>
<p class="purpose">To scan a Markdown tree of documentation and accumulate a set of index lemmas.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Whereas a term is a hypothetical index entry, a lemma is an actual one,
and consists of a (categorised) term together with some locations at which it
can be found. We represent locations as follows:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">volume_number</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">markdown_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">latest</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">IFM_example</span><span class="plain-syntax"> *</span><span class="identifier-syntax">example</span><span class="plain-syntax">;</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::nowhere</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::nowhere</span></span>:<br/><a href="7-il.html#SP4">&#167;4</a>, <a href="7-il.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">volume_number</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">example</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">latest</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::somewhere</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::somewhere</span></span>:<br/><a href="7-il.html#SP9_1">&#167;9.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">volume_number</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; ((</span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">example</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">latest</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure cd_index_location is accessed in 7/gi and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>There are two sorts of location a lemma can have: positions in the Markdown
text, and cross-references to other lemmas, although they are actually stored
not as lemmas but as categorised terms for timing reasons. (That is, so that
one lemma can cross-reference another which does not yet exist but which will
be created later.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">term</span><span class="plain-syntax">; </span><span class="comment-syntax"> term of lemma</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">references</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">index_reference</span></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cross_references</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">index_cross_reference</span></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sorting_key</span><span class="plain-syntax">; </span><span class="comment-syntax"> final reading order is alphabetic on this</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">; </span><span class="comment-syntax"> one of the </span><span class="extract"><span class="extract-syntax">*_LEMMASOURCE</span></span><span class="comment-syntax"> constants</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">categories_to_show</span><span class="plain-syntax">; </span><span class="comment-syntax"> display the last N categories of the term (normally 1; 0 means skip this lemma entirely)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_reference</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">index_reference</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">P</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::add_reference</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::add_reference</span></span>:<br/><a href="7-il.html#SP9_1">&#167;9.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax">, </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">index_reference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ref</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">index_reference</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ref</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">posn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">posn</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">ref</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_reference</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">references</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::add_cross_reference</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::add_cross_reference</span></span>:<br/><a href="7-il.html#SP9_1">&#167;9.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax">, </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">see</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">xref</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">xref</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">P</span><span class="plain-syntax"> = </span><span class="identifier-syntax">see</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">xref</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cross_references</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure index_lemma is accessed in 7/id, 7/gi and here.</li><li>The structure index_reference is accessed in 7/gi and here.</li><li>The structure index_cross_reference is accessed in 7/gi and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>The following guarantees that every lemma comes from a term; every lemma is
stored in the dictionary; and that if a lemma exists for a term, then it exists
for each initial sub-term. Thus, if a lemma exists for "food: dairy products:
soured cream", then lemmas for "food" and "food: dairy products" also exist.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="function-syntax">IndexLemmas::ensure</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::ensure</span></span>:<br/><a href="7-il.html#SP9_1">&#167;9.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">P</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><a href="7-it.html#SP5" class="function-link"><span class="function-syntax">IndexTerms::subterms</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax"> &lt;= </span><span class="identifier-syntax">N</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">PT</span><span class="plain-syntax"> = </span><a href="7-it.html#SP5" class="function-link"><span class="function-syntax">IndexTerms::truncated</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">il</span><span class="plain-syntax"> = </span><a href="7-id.html#SP2" class="function-link"><span class="function-syntax">IndexingData::retrieve_lemma</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">PT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">il</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">references</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">index_reference</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cross_references</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">index_cross_reference</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sorting_key</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">lemma_source</span><span class="plain-syntax"> = </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">categories_to_show</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><a href="7-id.html#SP2" class="function-link"><span class="function-syntax">IndexingData::store_lemma</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">il</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The following scan is slightly deceptive. It looks as if it works through the
main Markdown tree for the documentation, and then through individual trees
for the examples in turn. In fact the second scan (though examples) only does
anything if the examples in question are not placed anywhere in the tree;
for the main Inform documentation, that's never true, but for extension
documentation it can be.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::scan_documentation</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::scan_documentation</span></span>:<br/>Documentation Compiler - <a href="7-dc.html#SP21">&#167;21</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax"> = </span><a href="7-il.html#SP1" class="function-link"><span class="function-syntax">IndexLemmas::nowhere</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">latest</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">markdown_content</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="7-il.html#SP5" class="function-link"><span class="function-syntax">IndexLemmas::scan_documentation_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">cd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">markdown_content</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IFM_example</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">, </span><span class="identifier-syntax">IFM_example</span><span class="plain-syntax">, </span><span class="identifier-syntax">cd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">examples</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax"> = </span><a href="7-il.html#SP1" class="function-link"><span class="function-syntax">IndexLemmas::nowhere</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">latest</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">markdown_content</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">posn</span><span class="plain-syntax">.</span><span class="element-syntax">example</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="7-il.html#SP5" class="function-link"><span class="function-syntax">IndexLemmas::scan_documentation_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">header</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>The scanner works through the tree, tracking the currently enclosing volume,
chapter or section heading, and example heading, in search of <span class="extract"><span class="extract-syntax">INDEX_MARKER_MIT</span></span>
Markdown nodes. Note that the scan descends through examples only where they are
underneath a subheading; that will be true for examples located in a section,
but not for stand-alone ones, which do not have <span class="extract"><span class="extract-syntax">INFORM_EXAMPLE_HEADING_MIT</span></span> nodes.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::scan_documentation_r</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::scan_documentation_r</span></span>:<br/><a href="7-il.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">markdown_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">md</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">posn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">INFORM_EXAMPLE_HEADING_MIT</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">latest</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">IFM_example</span><span class="plain-syntax"> *</span><span class="identifier-syntax">save_E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">example</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">IFM_example</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RETRIEVE_POINTER_IFM_example</span><span class="plain-syntax">(</span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">user_state</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="7-il.html#SP6" class="function-link"><span class="function-syntax">IndexLemmas::index_example_header</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, *</span><span class="identifier-syntax">posn</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">, </span><span class="constant-syntax">EG_NAME_LEMMASOURCE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ex_index</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::ne</span><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ex_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><a href="7-il.html#SP6" class="function-link"><span class="function-syntax">IndexLemmas::index_example_header</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, *</span><span class="identifier-syntax">posn</span><span class="plain-syntax">, </span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ex_index</span><span class="plain-syntax">, </span><span class="constant-syntax">EG_ALT_LEMMASOURCE</span><span class="plain-syntax">);</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">example</span><span class="plain-syntax"> = </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">markdown_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax">=</span><span class="identifier-syntax">ch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="7-il.html#SP5" class="function-link"><span class="function-syntax">IndexLemmas::scan_documentation_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">ch</span><span class="plain-syntax">, </span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">example</span><span class="plain-syntax"> = </span><span class="identifier-syntax">save_E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">md</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">type</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">VOLUME_MIT:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">volume_number</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">HEADING_MIT:</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Markdown::get_heading_level</span><span class="plain-syntax">(</span><span class="identifier-syntax">md</span><span class="plain-syntax">) &lt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) </span><span class="identifier-syntax">posn</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">latest</span><span class="plain-syntax"> = </span><span class="identifier-syntax">md</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INDEX_MARKER_MIT:</span>
<span class="plain-syntax">                </span><a href="7-il.html#SP7" class="function-link"><span class="function-syntax">IndexLemmas::index_marker</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">md</span><span class="plain-syntax">, *</span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">markdown_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax">; </span><span class="identifier-syntax">ch</span><span class="plain-syntax">=</span><span class="identifier-syntax">ch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="7-il.html#SP5" class="function-link"><span class="function-syntax">IndexLemmas::scan_documentation_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">ch</span><span class="plain-syntax">, </span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>Note that exactly one entry of source <span class="extract"><span class="extract-syntax">EG_NAME_LEMMASOURCE</span></span> is made
per example, but that in addition a bonus entry can be made if the example
file asks for it, of source <span class="extract"><span class="extract-syntax">EG_ALT_LEMMASOURCE</span></span>.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">BODY_LEMMASOURCE</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">EG_NAME_LEMMASOURCE</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">EG_ALT_LEMMASOURCE</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::index_example_header</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::index_example_header</span></span>:<br/><a href="7-il.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">normalised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><a href="7-it.html#SP2" class="function-link"><span class="function-syntax">IndexTerms::parse_normalised</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="7-il.html#SP9" class="function-link"><span class="function-syntax">IndexLemmas::make</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">posn</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>Every other entry will have source <span class="extract"><span class="extract-syntax">BODY_LEMMASOURCE</span></span>, and will arise from an
index-marker Markdown node, i.e., from a usage of <span class="extract"><span class="extract-syntax">^{caret and braces}</span></span> in the
documentation source. The node is <span class="extract"><span class="extract-syntax">md</span></span>, and <span class="extract"><span class="extract-syntax">posn</span></span> is where it lives.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::index_marker</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::index_marker</span></span>:<br/><a href="7-il.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">markdown_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">md</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">carets</span><span class="plain-syntax"> = </span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax"> = </span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">stashed</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">see</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">alphabetise_as</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="7-il.html#SP7_1" class="named-paragraph-link"><span class="named-paragraph">Parse the alphabetisation and see</span><span class="named-paragraph-number">7.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">normalised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">carets</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><a href="7-it.html#SP2" class="function-link"><span class="function-syntax">IndexTerms::parse_normalised_adjusting</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">md</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><a href="7-it.html#SP2" class="function-link"><span class="function-syntax">IndexTerms::parse_normalised</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">carets</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">3</span><span class="plain-syntax">) </span><a href="7-il.html#SP9" class="function-link"><span class="function-syntax">IndexLemmas::make</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">posn</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">BODY_LEMMASOURCE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="7-il.html#SP7_2" class="named-paragraph-link"><span class="named-paragraph">Deal with alphabetisation</span><span class="named-paragraph-number">7.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="7-il.html#SP7_3" class="named-paragraph-link"><span class="named-paragraph">Deal with see</span><span class="named-paragraph-number">7.3</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">see</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">alphabetise_as</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7_1" class="paragraph-anchor"></a><b>&#167;7.1. </b>Note that this is not a passive operation: we are modifying the stashed text
inside the Markdown node. (And in some cases, <span class="extract"><span class="extract-syntax">IndexTerms::parse_normalised_adjusting</span></span>
modifies the plain node following it, too.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the alphabetisation and see</span><span class="named-paragraph-number">7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"(%c+?) *&lt;-- *(%c+) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]); </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"(%c+?) *--&gt; *(%c+) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">term_to_index</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]); </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">alphabetise_as</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="7-il.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_2" class="paragraph-anchor"></a><b>&#167;7.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Deal with alphabetisation</span><span class="named-paragraph-number">7.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">alphabetise_as</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="7-id.html#SP9" class="function-link"><span class="function-syntax">IndexingData::make_exception</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="7-it.html#SP4" class="function-link"><span class="function-syntax">IndexTerms::categorise</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">), </span><span class="identifier-syntax">alphabetise_as</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="7-il.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7_3" class="paragraph-anchor"></a><b>&#167;7.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Deal with see</span><span class="named-paragraph-number">7.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *(%c+) *&lt;-- *(%c+?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">        </span><a href="7-il.html#SP8" class="function-link"><span class="function-syntax">IndexLemmas::see</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">see</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><a href="7-il.html#SP8" class="function-link"><span class="function-syntax">IndexLemmas::see</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="7-il.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::see</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::see</span></span>:<br/><a href="7-il.html#SP7_3">&#167;7.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="reserved-syntax">normalised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="7-it.html#SP4" class="function-link"><span class="function-syntax">IndexTerms::categorise</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">normalised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">SN</span><span class="plain-syntax"> = </span><a href="7-it.html#SP2" class="function-link"><span class="function-syntax">IndexTerms::parse_normalised</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">see</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="7-il.html#SP9" class="function-link"><span class="function-syntax">IndexLemmas::make</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">SN</span><span class="plain-syntax">, </span><a href="7-il.html#SP1" class="function-link"><span class="function-syntax">IndexLemmas::nowhere</span></a><span class="plain-syntax">(), &amp;</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="constant-syntax">BODY_LEMMASOURCE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>Some categories cause their terms to be relocated, and this is automatically
handled in the categorisation process, but others cause them to be _both_
relocated _and_ still in the original, unrelocated position. For those, we
need to make two different categorisations, and create at both.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::make</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::make</span></span>:<br/><a href="7-il.html#SP6">&#167;6</a>, <a href="7-il.html#SP7">&#167;7</a>, <a href="7-il.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="reserved-syntax">normalised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">cd_index_location</span><span class="plain-syntax"> </span><span class="identifier-syntax">posn</span><span class="plain-syntax">, </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> *</span><span class="identifier-syntax">see</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="7-it.html#SP4" class="function-link"><span class="function-syntax">IndexTerms::categorise</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">indexing_category</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ic</span><span class="plain-syntax"> = </span><a href="7-it.html#SP5" class="function-link"><span class="function-syntax">IndexTerms::final_category</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ic</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">ic</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cat_alsounder</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">categorised_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="7-it.html#SP4" class="function-link"><span class="function-syntax">IndexTerms::categorise_unrelocated</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="7-il.html#SP9_1" class="named-paragraph-link"><span class="named-paragraph">Make at P</span><span class="named-paragraph-number">9.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="7-il.html#SP9_1" class="named-paragraph-link"><span class="named-paragraph">Make at P</span><span class="named-paragraph-number">9.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9_1" class="paragraph-anchor"></a><b>&#167;9.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make at P</span><span class="named-paragraph-number">9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="7-it.html#SP5" class="function-link"><span class="function-syntax">IndexTerms::erroneous</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax"> = </span><a href="7-il.html#SP3" class="function-link"><span class="function-syntax">IndexLemmas::ensure</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">lemma_source</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="7-il.html#SP1" class="function-link"><span class="function-syntax">IndexLemmas::somewhere</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">posn</span><span class="plain-syntax">)) </span><a href="7-il.html#SP2" class="function-link"><span class="function-syntax">IndexLemmas::add_reference</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">il</span><span class="plain-syntax">, </span><span class="identifier-syntax">posn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">see</span><span class="plain-syntax">) </span><a href="7-il.html#SP2" class="function-link"><span class="function-syntax">IndexLemmas::add_cross_reference</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">il</span><span class="plain-syntax">, *</span><span class="identifier-syntax">see</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="7-il.html#SP9">&#167;9</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>When created, lemmas have no sorting keys: those are made later.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::make_sorting_key</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::make_sorting_key</span></span>:<br/>Indexing Data - <a href="7-id.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">except</span><span class="plain-syntax"> = </span><a href="7-id.html#SP9" class="function-link"><span class="function-syntax">IndexingData::find_exception</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">except</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">except</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><a href="7-it.html#SP5" class="function-link"><span class="function-syntax">IndexTerms::serialise</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">term</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="comment-syntax"> ensure subentries follow main entries</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_first_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">) != </span><span class="character-syntax">':'</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">": *"</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"ZZZZZZZZZZZZZZZZZZZZZZ"</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="7-il.html#SP11" class="function-link"><span class="function-syntax">IndexLemmas::improve_alphabetisation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"a/%C+ (%c*)"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"the/%C+ (%c*)"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">id</span><span class="plain-syntax">.</span><span class="element-syntax">use_letter_alphabetisation</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"aaaaaaaaaaaaaaaaaaaaaa"</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::begins_with</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"( )"</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Str::begins_with</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"((-"</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Str::begins_with</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"((+"</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%(%c*?%)"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" "</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_first_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">) != </span><span class="character-syntax">','</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">","</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">f</span><span class="plain-syntax"> = </span><span class="character-syntax">' '</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::isalpha</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_first_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">f</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_first_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sorting_key</span><span class="plain-syntax">, </span><span class="string-syntax">"%c_%S=___=%S=___=%07d"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">f</span><span class="plain-syntax">, </span><span class="identifier-syntax">un</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">un</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>We flatten the casing and remove the singular articles; we count initial
small numbers as words, so that "3 Wise Monkeys" is filed as if it were "Three
Wise Monkeys"; with parts of multipart examples, such as "Disappointment
Bay 3", we insert zeroes before the 3 so that up to 99 parts can appear and
alphabetical sorting will agree with numerical.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::improve_alphabetisation</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::improve_alphabetisation</span></span>:<br/><a href="7-il.html#SP10">&#167;10</a><br/>Examples Index - <a href="7-ei.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compiled_documentation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cd</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::put</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">Characters::tolower</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"a "</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"an "</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"the "</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::put</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">Characters::tolower</span><span class="plain-syntax">(</span><span class="identifier-syntax">Characters::remove_accent</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">))));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%[ *%]"</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"____SQUARES____"</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%["</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%]"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"____SQUARES____"</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"[]"</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%("</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%)"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_REPEATING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"1 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"one "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"2 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"two "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"3 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"three "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"4 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"four "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"5 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"five "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"6 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"six "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"7 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"seven "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"8 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"eight "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"9 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"nine "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"10 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"ten "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"11 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"eleven "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::replace</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"12 "</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"twelve "</span><span class="plain-syntax">, </span><span class="identifier-syntax">REP_ATSTART</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">x</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::clear</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"(%c*?)(%d+)(%c*)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">x</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[2]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="string-syntax">"%08d"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::atoi</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1], </span><span class="constant-syntax">0</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">sort_key</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">x</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">x</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::cmp</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::cmp</span></span>:<br/>Indexing Data - <a href="7-id.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent1</span><span class="plain-syntax">, </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ent2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L1</span><span class="plain-syntax"> = *((</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> **) </span><span class="identifier-syntax">ent1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L2</span><span class="plain-syntax"> = *((</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> **) </span><span class="identifier-syntax">ent2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Str::cmp</span><span class="plain-syntax">(</span><span class="identifier-syntax">L1</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sorting_key</span><span class="plain-syntax">, </span><span class="identifier-syntax">L2</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sorting_key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">IndexLemmas::has_references</span><button class="popup" onclick="togglePopup('usagePopup15')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup15">Usage of <span class="code-font"><span class="function-syntax">IndexLemmas::has_references</span></span>:<br/>General Index - <a href="7-gi.html#SP1_1">&#167;1.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">index_lemma</span><span class="plain-syntax"> *</span><span class="identifier-syntax">il</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">references</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">il</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cross_references</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="7-it.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-sm.html">1</a></li><li class="progresschapter"><a href="2-gnr.html">2</a></li><li class="progresschapter"><a href="3-bg.html">3</a></li><li class="progresschapter"><a href="4-em.html">4</a></li><li class="progresschapter"><a href="5-es.html">5</a></li><li class="progresschapter"><a href="6-st.html">6</a></li><li class="progresscurrentchapter">7</li><li class="progresssection"><a href="7-tm.html">tm</a></li><li class="progresssection"><a href="7-eip.html">eip</a></li><li class="progresssection"><a href="7-ti.html">ti</a></li><li class="progresssection"><a href="7-tc.html">tc</a></li><li class="progresssection"><a href="7-dc.html">dc</a></li><li class="progresssection"><a href="7-dr.html">dr</a></li><li class="progresssection"><a href="7-im.html">im</a></li><li class="progresssection"><a href="7-mrp.html">mrp</a></li><li class="progresssection"><a href="7-id.html">id</a></li><li class="progresssection"><a href="7-it.html">it</a></li><li class="progresscurrent">il</li><li class="progresssection"><a href="7-imn.html">imn</a></li><li class="progresssection"><a href="7-gi.html">gi</a></li><li class="progresssection"><a href="7-ei.html">ei</a></li><li class="progressnext"><a href="7-imn.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

